<template>
  <tr>
    <td><input type="checkbox" v-model="obj.checked"></td>
    <td>{{ obj.name }}</td>
    <td>{{ obj.price }}</td>
    <td>
      <button :disabled="obj.num === 1" @click="obj.num--">-</button>
      {{ obj.num }}
      <button @click="obj.num++">+</button>
    </td>
    <td>
      {{ obj.num * obj.price }}
      </td>
    <td>
      <button @click="delGoods(index)">删除</button>
    </td>
  </tr>
</template>
 
<script>
import { mapMutations } from 'vuex';
export default {
  props: {
    obj: Object,
    index: Number
  },
  methods: {
    // 删除商品
    ...mapMutations(['delGoods']),
  }
};
</script>

<style scoped>
     
</style>